/***************************************************************************\
 * Copyright (C) by Keio University
 * PointCloud.hpp created in 08 2012.
 * Mail : fdesorbi@hvrl.ics.keio.ac.jp
 *
 * PointCloud.hpp is part of the HVRL Engine Library.
 *
 * The HVRL Engine Library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * The HVRL Engine Library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
\***************************************************************************/


#ifndef HVRL_POINT_CLOUD_HPP__
#define HVRL_POINT_CLOUD_HPP__

#include "Size.hpp"

namespace hvrl{

class PointCloud {

public:

	PointCloud(void):pointcloud(0) {};

	~PointCloud(void) {
		if(this->pointcloud != 0){
			delete[] pointcloud;
		}
	};

	void setSize(const Size& s) {
		this->size = s;
		if(this->pointcloud != 0){
			delete[] this->pointcloud;
		}
		this->pointcloud = new float[4 * s.width * s.height];
	}

	Size getSize(void) const { return this->size; }

	float* getData(void) { return this->pointcloud; }
	const float* getData(void) const { return this->pointcloud; }

private:

	float* pointcloud;
	Size size;

};

}

#endif
